package cn.cvs.pojo;

import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.Arrays;
import java.util.List;

/**
 * 用户
 */
@Alias("user")//  tSysUser
@XmlRootElement
public class TSysUser {

  private Long id;
  private String account;
  private String realName;
  private String password;
  private Integer sex;
 // @DateTimeFormat(pattern = "yyyy-MM-dd")
  private String birthday;
  private String phone;
  private String address;
  private Long roleId;
  private Long createdUserId;
  private String createdTime;
  private Long updatedUserId;
  private String updatedTime;
  private String idPicPath;
  private String workPicPath;

  private String roleName;
  private Integer age;

  private TSysRole sysRole;//用户对应的角色

  private List<TAddress> addressList;//收货地址

  private Integer[] roleIds;

  public TSysUser() {
  }


  //public TSysUser(String queryRealName, Long aLong){}

  public TSysUser(String realName, Long roleId) {
    this.realName = realName;
    this.roleId = roleId;
  }

    public TSysUser(Long id) {
        this.id = id;
    }

    public TSysUser(String account) {
    this.account = account;
  }
    public TSysUser(String account, String password) {
      this.account = account;
      this.password =password;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getCreatedUserId() {
        return createdUserId;
    }

    public void setCreatedUserId(Long createdUserId) {
        this.createdUserId = createdUserId;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public Long getUpdatedUserId() {
        return updatedUserId;
    }

    public void setUpdatedUserId(Long updatedUserId) {
        this.updatedUserId = updatedUserId;
    }

    public String getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(String updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getIdPicPath() {
        return idPicPath;
    }

    public void setIdPicPath(String idPicPath) {
        this.idPicPath = idPicPath;
    }

    public String getWorkPicPath() {
        return workPicPath;
    }

    public void setWorkPicPath(String workPicPath) {
        this.workPicPath = workPicPath;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public TSysRole getSysRole() {
        return sysRole;
    }

    public void setSysRole(TSysRole sysRole) {
        this.sysRole = sysRole;
    }

    public List<TAddress> getAddressList() {
        return addressList;
    }

    public void setAddressList(List<TAddress> addressList) {
        this.addressList = addressList;
    }

    public Integer[] getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(Integer[] roleIds) {
        this.roleIds = roleIds;
    }

    @Override
    public String toString() {
        return "TSysUser{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", realName='" + realName + '\'' +
                ", password='" + password + '\'' +
                ", sex=" + sex +
                ", birthday='" + birthday + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", roleId=" + roleId +
                ", createdUserId=" + createdUserId +
                ", createdTime='" + createdTime + '\'' +
                ", updatedUserId=" + updatedUserId +
                ", updatedTime='" + updatedTime + '\'' +
                ", idPicPath='" + idPicPath + '\'' +
                ", workPicPath='" + workPicPath + '\'' +
                ", roleName='" + roleName + '\'' +
                ", age=" + age +
                ", sysRole=" + sysRole +
                ", addressList=" + addressList +
                ", roleIds=" + Arrays.toString(roleIds) +
                '}';
    }
}
